//
//  PhoneMacro.h
//  TooToo
//
//  Created by liuning on 15/12/21.
//  Copyright © 2015年 MoHao. All rights reserved.
//

#ifndef PhoneMacro_h
#define PhoneMacro_h

//根据size判断iPhone X
#define Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

/* 尺寸 */
#define IPHONEWIDTH  [UIScreen mainScreen].bounds.size.width
#define IPHONEHEIGHT  [UIScreen mainScreen].bounds.size.height

#define StatusHeight (Is_iPhoneX?44:20) //因为只系统支持版本是7.0以上，所以写死20
#define NavBarHeight (Is_iPhoneX?88:64)
#define TabbarHeight (Is_iPhoneX?83:49)
#define IPhoneXDel   (Is_iPhoneX?24:0)            //iPhoneX与其他手机顶部的高度差

//转换
#define UISCALE IPHONEWIDTH/375.0f

/* 版本控制 */
#define CURRENT_DATA_VERSION            @"1.0.0"

/* 判断iOS版本 */

//系统版本等于多少 ==
#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
//系统版本大于多少 >
#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
//系统版本大于等于多少 >=
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
//系统版本小于多少 <
#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
//系统版本小于等于多少 <=
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

/* 判断设备 */
#define   iPhone4  [UIScreen mainScreen].bounds.size.height < 500
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size)  : NO)
#define iPhone6plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(1080,1920), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size)) : NO)

#endif /* PhoneMacro_h */
